/*
 * @Author: leonard
 * @Date: 2024-12-31 22:13:26
 * @LastEditors: leonard 1287279970@qq.com
 * @LastEditTime: 2025-01-04 02:19:56
 * @FilePath: /amap-admin/src/App.js
 * @Description: 
 * 
 * Copyright (c) 2024 by flyray Technology CO., Ltd, All Rights Reserved. 
 */
import React from 'react';
import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom';
import { Layout } from 'antd';
import Home from './pages/Home';
import Sensor from './pages/Sensor';
import Map from './pages/Map';
import MapTrack from './pages/MapTrack';
import './App.less';

const { Content } = Layout;

const App = () => {
  return (
    <Router>
      <Layout className="app-container">
        <Content>
          <Routes>
            {/* 默认重定向到首页 */}
            <Route path="/" element={<Navigate to="/home" replace />} />
            {/* 首页路由 */}
            <Route path="/home" element={<Home />} />
            {/* sensor路由 */}
            <Route path="/sensor" element={<Sensor />} />
            {/* 地图路由 */}
            <Route path="/map" element={<Map />} />
            {/* 地图轨迹路由 */}
            <Route path="/map-track" element={<MapTrack />} />
          </Routes>
        </Content>
      </Layout>
    </Router>
  );
};

export default App;
